package com.handydata.antifraud.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.handydata.common.dao.AbsBaseDao;
import com.handydata.antifraud.dao.DataCallLogsDao;
import com.handydata.antifraud.entity.DataCallLogsDO;
import com.handydata.antifraud.entity.DataOriginManageBeanDO;
import com.handydata.antifraud.entity.QueryDataOriginDetailReqDO;
import com.handydata.antifraud.entity.QueryDataOriginDetailResDO;
import com.handydata.antifraud.entity.QueryDataOriginManageReqDO;
import com.handydata.antifraud.entity.QueryDataOriginManageResDO;

/**
 * 调用数据平台日志
 * 
 * @author guolong
 * @email jishu@handy-data.cn
 * @date 2019-08-18 20:57:31
 */
 @Repository
public class DataCallLogsDaoImpl extends AbsBaseDao<DataCallLogsDO> implements DataCallLogsDao {
	 
	/**
	 * 数据源管理查询
	 * @param req
	 * @return
	 */
	@Override
	public List<QueryDataOriginManageResDO> queryDataOriginManage(QueryDataOriginManageReqDO req){
		return sqlSession.selectList(this.namespace.concat(".queryDataOriginManage"), req);
	}
	
	/**
	 * 统计数据源调用次数
	 * @param req
	 * @return
	 */
	@Override
	public long countDataOriginManage(QueryDataOriginManageReqDO req) {
		return sqlSession.selectOne(this.namespace.concat(".countDataOriginManage"), req);
	}

	/**
	 * 数据源详情查询
	 * @param req
	 * @return
	 */
	@Override
	public QueryDataOriginDetailResDO queryDataOriginManageDetail(QueryDataOriginDetailReqDO req) {
		return sqlSession.selectOne(this.namespace.concat(".queryDataOriginManageDetail"), req);
	}

	/**
	 * 具体某个数据源调用列表查询
	 * @param req
	 * @return
	 */
	@Override
	public List<DataOriginManageBeanDO> queryDataCallByCondition(QueryDataOriginDetailReqDO req) {
		return sqlSession.selectList(this.namespace.concat(".queryDataCallByCondition"), req);
	}
	
}
